﻿using SqlSugar;
using System;

namespace SEIPropertyDataService.Entity.Models
{
    /// <summary>
    /// 安全事件日志模型
    /// </summary>
    [SugarTable("security_incident_log_{year}{month}{day}")]
    [SplitTable(SplitType.Season)]//按季分表 （自带分表支持 年、季、月、周、日）
    public class SecurityIncidentLogModel
    {
        /// <summary>
        /// id
        /// </summary>
        [SugarColumn(IsPrimaryKey = true)]
        public string Id { get; set; }
        /// <summary>
        /// 事件发生时间
        /// </summary>
        public DateTime EventTime { get; set; } = DateTime.UtcNow;
        /// <summary>
        /// 事件发生的IP地址
        /// </summary>
        [SugarColumn(IsNullable = true)]
        public string IPAddress { get; set; }
        /// <summary>
        /// 关联的业务数据ID（如用户ID等）
        /// </summary>
        [SugarColumn(IsNullable = true)]
        public string UserId { get; set; } // 关联的业务数据
        /// <summary>
        /// 事件发生的路径或URL
        /// </summary>
        [SugarColumn(IsNullable = true)]
        public string Path { get; set; }
        /// <summary>
        /// 事件类型
        /// </summary>
        [SugarColumn(IsNullable = true)]
        public string EventType { get; set; } // 404/SQL Injection/等
        /// <summary>
        /// 描述信息
        /// </summary>
        [SugarColumn(IsNullable = true, ColumnDataType = "Text")]
        public string Description { get; set; }
    }
}
